import dt from '@dt/dt'

function options(_this) {
  return [
    {
      type: 'index',
      title: '序号',
      minWidth: 70
    },
    {
      field: 'rankPointsName',
      title: '职级点数模板名称',
      minWidth: 180
    },
    {
      field: 'date',
      title: '生效日期',
      minWidth: 210,
      cell: {
        value: (row) => {
          return `${row.effectiveStartDate} ~ ${row.effectiveEndDate}`
        },
        text: {}
      }
    },
    {
      field: 'isJumpPointStr',
      title: '是否跳点',
      minWidth: 80,
    },
    {
      field: 'createTime',
      title: '创建日期',
      minWidth: 120,
    },
    {
      title: '状态',
      minWidth: 80,
      cell: (row) => {
        return {
          value: (row) => row.statusStr,
          text: {
            color: row.status == 'NO_PASS' ? 'red' : null
          }
        }
      }
    },
    {
      field: 'handles',
      title: '操作',
      width: 230,
      fixed: 'right',
      cell: (row) => {
        return {
          btn: [{
            title: '查看',
            event: 'onDetail'
          }, {
            title: '撤回',
            event: 'onBack',
            code: '0112040202',
            visible: row.status == 'APPROVAL'
          }, {
            title: '流程信息',
            event: 'onFlow',
          }, {
            title: '复制模板',
            event: 'onCopy',
            code: '0112040203'
          }, {
            title: '删除',
            event: 'onDelete',
            code: '0112040204',
            visible: row.status == 'NO_PASS' || row.status == 'WITHDRAWN'
          }]
        }
      }
    }
  ]
}

export default {
  options
}
